From: John Tsichritzis Date: Wed, 22 Aug 2018 11:36:37 +0000 (+0100) Subject: Support shared Mbed TLS heap for SGI X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=7cdb43470a1b97fdd5c0ed36c69ea6913b4f96b6;p=project%2Fbcm63xx%2Fatf.git Support shared Mbed TLS heap for SGI Change-Id: Iac454c745543842bfeed004aee7a3f4fb94d37e1 Signed-off-by: John Tsichritzis --- diff --git a/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts b/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts index 0bb0a94e..315fa699 100644 --- a/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts +++ b/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts @@ -11,4 +11,15 @@ compatible = "arm,tb_fw"; hw_config_addr = <0x0 0xFEF00000>; hw_config_max_size = <0x0100000>; + /* + * The following two entries are placeholders for Mbed TLS + * heap information. The default values don't matter since + * they will be overwritten by BL1. + * In case of having shared Mbed TLS heap between BL1 and BL2, + * BL1 will populate these two properties with the respective + * info about the shared heap. This info will be available for + * BL2 in order to locate and re-use the heap. + */ + mbedtls_heap_addr = <0x0 0x0>; + mbedtls_heap_size = <0x0>; }; diff --git a/plat/arm/css/sgi/sgi_plat.c b/plat/arm/css/sgi/sgi_plat.c index 6aa76efe..0a7e319d 100644 --- a/plat/arm/css/sgi/sgi_plat.c +++ b/plat/arm/css/sgi/sgi_plat.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -63,6 +64,9 @@ const mmap_region_t plat_arm_mmap[] = { #endif #if ENABLE_SPM ARM_SP_IMAGE_MMAP, +#endif +#if TRUSTED_BOARD_BOOT && LOAD_IMAGE_V2 && !BL2_AT_EL3 + ARM_MAP_BL1_RW, #endif {0} }; @@ -143,3 +147,13 @@ const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( return &plat_arm_secure_partition_boot_info; } #endif /* ENABLE_SPM && defined(IMAGE_BL31) */ + +#if TRUSTED_BOARD_BOOT && LOAD_IMAGE_V2 +int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size) +{ + assert(heap_addr != NULL); + assert(heap_size != NULL); + + return arm_get_mbedtls_heap(heap_addr, heap_size); +} +#endif